<template>
	<view>
		<swiper-video-image
		    :list="list"
		    autoplay
		    circular
		    autoPlayVideo
		    ref="swiperVideoImage"
		    @swiperClick="swiperClick"
		    @swiperChange="swiperChange"
		></swiper-video-image>
		
		
	</view>
</template>

<script>
	export default {
	    data() {
	        return {
	            list: [
	                { type: 'video', link: 'https://cdn.uviewui.com/uview/resources/video.mp4' },
	                { type: 'img', link: 'https://cdn.uviewui.com/uview/swiper/swiper1.png' },
	                { type: 'img', link: 'https://cdn.uviewui.com/uview/swiper/swiper2.png' }
	            ]
	        };
	    },
	    methods: {
	        // swiper切换时触发的回调
	        swiperChange(index) {
	            console.log(index)
	        },
	        // 点击当前视频或图片的回调
	        swiperClick(e, index) {
	            console.log(e, index)
	        },
	        // 暂停当前视频播放
	        pause() {
	            this.$refs.swiperVideoImage.pause()
	        },
	        // 播放当前视频
	        play() {
	            this.$refs.swiperVideoImage.play()
	        }
	    }
	};
</script>

<style>
</style>